package com.ele.web;

import com.ele.pojo.Foodtype;
import com.ele.pojo.ResponseData;
import com.ele.service.FoodtypeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Tag(name = "FoodtypeController", description = "菜品分类")
public class FoodtypeController {
    @Resource
    private FoodtypeService foodtypeService;

    @GetMapping("/getFoodType")
    @Operation(summary = "获取菜品分类")
    @Parameter(name="businessId",description = "店铺ID")
    @ApiResponse(description = "获取菜品分类成功" ,
            content = @Content(mediaType="application/json",
                    schema=@Schema(implementation = ResponseData.class)))
    public ResponseData<Foodtype> getFoodType(String businessId){
        return this.foodtypeService.getFoodType(businessId);
    }
}